<?php 
function getRealIpAddress() {
  return !empty($_SERVER['HTTP_CLIENT_IP']) ?
          $_SERVER['HTTP_CLIENT_IP'] : (!empty($_SERVER['HTTP_X_FORWARDED_FOR']) ?
                  $_SERVER['HTTP_X_FORWARDED_FOR'] : (!empty($_SERVER['REMOTE_ADDR']) ?
                          $_SERVER['REMOTE_ADDR'] : null));
}
?>

<?php 
$kimlik = getRealIpAddress(); 
echo $kimlik; 


/*
	$array["a"]["1"] = "Foo";
	$array["b"] = "Bar";
	$array["c"] = "Baz";
	$array["d"] = "Wom";
	
	$str = serialize($array);
	$strenc = urlencode($str);
	//print $str . "\n";
	//print $strenc . "\n";
	
	
	$arr = unserialize($str);
	var_dump($arr);
	echo "<br>sss";
	
	
	
	foreach ($arr as $key_name => $key_value) {
	
		print "Key = " . $key_name . " Value = " . $key_value[1] . "<BR>";
	
	}
	


?>

				if ($telafi_kim[$i] == 'Kendim') { echo "<div style=\"display:yes\" id=\"kendim".$i."\""; } else { echo "<div style=\"display:none\" id=\"kendim".$i."\""; }
					if ($telafi_kim[$i] == 'Kendim') { echo "<input type=\"text\" id=\"telafi_sinif\" name=\"telafi_sinif[]\" value=\"".$telafi_sinif[$i]."\"  placeholder=\"Hangi sınıfta?\">"; }
					if ($telafi_kim[$i] == 'Kendim') { echo "<input type=\"text\" id=\"telafi_tarih\" name=\"telafi_tarih[]\" value=\"".$telafi_tarih[$i]."\"  placeholder=\"Ne zaman?\" readonly=\"readonly\">"; }
				echo "</div>";	
				if ($telafi_kim[$i] == 'Diger') { echo "<div style=\"display:yes\" id=\"diger".$i."\""; } else { echo "<div style=\"display:none\" id=\"diger".$i."\""; }
				if ($telafi_kim[$i] == 'Diger') { echo "<input type=\"text\" id=\"telafi_hoca\" name=\"telafi_hoca[]\" value=\"".$telafi_hoca[$i]."\"  placeholder=\"Kim? Ünvanı, adı ve soyadı\">"; }
				echo "</div>";
				
				
				
				
				for ($i=1; $i<count($telafi_ders_adi); $i++) {

				echo "<label for=\"form1\"></label>";
				echo "<input type=\"text\" id=\"telafi_ders_adi\" name=\"telafi_ders_adi[]\" value=\"".$telafi_ders_adi[$i]."\" placeholder=\"Ders adı\">";
				echo "<select class=\"selectShort3\" type=\"text\" id=\"telafi_kim\" name=\"telafi_kim[]\" onChange=\"return setForm3(this, ".$i.")\">";
				echo "<option value=\"\">Kim telafi edecek?</option>";
					if ($telafi_kim[$i] == 'Kendim') { echo "<option value=\"Kendim\" selected>Kendim telafi edeceğim</option>"; } else { echo "<option value=\"Kendim\">Kendim telafi edeceğim</option>"; }
					if ($telafi_kim[$i] == 'Diger') { echo "<option value=\"Diger\" selected>Diğer bir öğretim üyesi</option>"; } else { echo "<option value=\"Diger\">Diğer bir öğretim üyesi</option>"; }
				echo "</select>";
				
				if ($telafi_kim[$i] == 'Kendim') { echo "<div style=\"display:yes\" id=\"kendim".$i."\">"; } else { echo "<div style=\"display:none\" id=\"kendim".$i."\">"; }			
					if ($telafi_kim[$i] == 'Kendim') { echo "<input type=\"text\" id=\"telafi_sinif\" name=\"telafi_sinif[]\" value=\"".$telafi_sinif[$i]."\"  placeholder=\"Hangi sınıfta?\">&nbsp;"; }
					if ($telafi_kim[$i] == 'Kendim') { echo "<input type=\"text\" id=\"telafi_tarih".$i."\" name=\"telafi_tarih[]\" value=\"".$telafi_tarih[$i]."\"  placeholder=\"Ne zaman?\" readonly=\"readonly\">"; }		
				echo "</div>";	
				if ($telafi_kim[$i] == 'Diger') { echo "<div style=\"display:yes\" id=\"diger".$i."\">"; } else { echo "<div style=\"display:none\" id=\"diger".$i."\">"; }
				if ($telafi_kim[$i] == 'Diger') { echo "<input type=\"text\" id=\"telafi_hoca\" name=\"telafi_hoca[]\" value=\"".$telafi_hoca[$i]."\"  placeholder=\"Kim? Ünvanı, adı ve soyadı\">"; }
				echo "</div>";

					
			}
			
			
			
<script type="text/javascript">

	var oTable;

	$(document).ready(function()
		{
		$(".faculty_id").change(function()
		{
		var id=$(this).val();
		var dataString = 'id='+ id;
		
		$.ajax
			({
			type: "POST",
			url: "reports/ajaxdepartments.php",
			data: dataString,
			cache: false,
			success: function(html)
			{
			$(".department_id").html(html);
			} 
			});
		});
	});



	$(document).ready(function() {

			

			$('#form form').submit(function(){
		        $('#reportResult').load('reports/getreport.php', { 'name': $('input[name="urname"]').val()});        
		        $(".contentTopArea").hide();             
		        return false;
		    });
	});
	
		

	$(document).ready(function() {
	    Add a click handler to the rows - this could be used as a callback 

		
		
		

		oTable = $('#example').dataTable({
	        "sPaginationType": "full_numbers",
			"sDom": 'f<"toolbar">t<lip><"clear">'
		});

		

		
	} );
	</script>
	
	
	
	*/